3 ...\PTVR_Researchers\Python_Scripts\Demos\Pointing\
4 reticle_on_different_bckgnd_colors.py
6 This demo is the same as the reticle.py script except that:
7 - the 'two_colors' parameter is set to "True" in ReticleImageFromDrawing()
8 In this case, the reticle is made of two contours (white and black),
9 which makes it ideal for a background containing dark and bright patches
12 - there are five Flat Screens with different luminances (from black to
14 so that you can move the reticle above dark or bright surfaces and check
15 that the reticle is clearly visible in all cases.
17 Created by Carlos Aguilar in March 2025
30 my_contingency = ImageContingency.HEADSET
45 reticle_2D_image = RG.ReticleImageFromDrawing(
57 image=reticle_2D_image,
58 contingency_type=my_contingency)
59 my_scene.place_contingent_cursor(my_reticle)
61 flat_screen_1 =
FlatScreen(position_in_current_CS=np.array([-2, 0, 3]),
62 color=color.RGBColor(r=grey_level_1, g=grey_level_1,
63 b=grey_level_1, a=1.0))
64 flat_screen_2 =
FlatScreen(position_in_current_CS=np.array([-1, 0, 3]),
65 color=color.RGBColor(r=grey_level_2, g=grey_level_2,
66 b=grey_level_2, a=1.0))
67 flat_screen_3 =
FlatScreen(position_in_current_CS=np.array([0, 0, 3]),
68 color=color.RGBColor(r=grey_level_3, g=grey_level_3,
69 b=grey_level_3, a=1.0))
70 flat_screen_4 =
FlatScreen(position_in_current_CS=np.array([1, 0, 3]),
71 color=color.RGBColor(r=grey_level_4, g=grey_level_4,
72 b=grey_level_4, a=1.0))
73 flat_screen_5 =
FlatScreen(position_in_current_CS=np.array([2, 0, 3]),
74 color=color.RGBColor(r=grey_level_5, g=grey_level_5,
75 b=grey_level_5, a=1.0))
76 my_scene.place(flat_screen_1, my_world)
77 my_scene.place(flat_screen_2, my_world)
78 my_scene.place(flat_screen_3, my_world)
79 my_scene.place(flat_screen_4, my_world)
80 my_scene.place(flat_screen_5, my_world)
82 my_world.add_scene(my_scene)
86 if __name__ ==
"__main__":
def LaunchThe3DWorld(jsonFileCategory="Externals")